home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_04 / window.h < prev   
C/C++ Source or Header  |  1994-03-20  |  3KB  |  97 lines

  1. /*
  2.  * DDS MICRO-C IBM/PC Window Library definitions
  3.  *
  4.  * Copyright 1990-1994 Dave Dunfield
  5.  * All rights reserved.
  6.  */
  7.  
  8. /* General keys */
  9. #define _KUA    0xff80            /* Up    arrow    */
  10. #define _KDA    0xff81            /* Down  arrow    */
  11. #define _KLA    0xff82            /* Left  arrow    */
  12. #define _KRA    0xff83            /* Right arrow    */
  13. #define _KPU    0xff84            /* PgUp            */
  14. #define _KPD    0xff85            /* PgDn            */
  15. #define _KHO    0xff86            /* Home            */
  16. #define _KEN    0xff87            /* End            */
  17. #define _KKP    0xff88            /* Keypad '+'    */
  18. #define _KKM    0xff89            /* Keypad '-'    */
  19. #define _KIN    0xff8a            /* Insert key    */
  20. #define _KDL    0xff8b            /* Delete key    */
  21. #define _KBS    0xff8c            /* Backspace    */
  22. /* Functions keys */
  23. #define _K1        0xff8d            /* Function 1    */
  24. #define _K2        0xff8e            /* Function 2    */
  25. #define _K3        0xff8f            /* Function 3    */
  26. #define _K4        0xff90            /* Function 4    */
  27. #define _K5        0xff91            /* Function 5    */
  28. #define _K6        0xff92            /* Function 6    */
  29. #define _K7        0xff93            /* Function 7    */
  30. #define _K8        0xff94            /* Function 8    */
  31. #define _K9        0xff95            /* Function 9    */
  32. #define _K10    0xff96            /* Function 10    */
  33. /* Special control keys */
  34. #define _CPU    0xff97            /* Control PgUp */
  35. #define _CPD    0xff98            /* Control PgDn */
  36. #define _CHO    0xff99            /* Control Home */
  37. #define _CEN    0xff9a            /* Control End  */
  38. #define    _CLA    0xff9b            /* Control Left arrow */
  39. #define    _CRA    0xff9c            /* Control Right arrow */
  40.  
  41. /*
  42.  * Window open attributes
  43.  */
  44. #define    WSAVE        0x8000        /* Save/Restore screen */
  45. #define    WBOX1        0x4000        /* Enable enclosing BORDER type 1 */
  46. #define    WBOX2        0x2000        /* Enable enclosing BORDER type 2 */
  47. #define    WBOX3        0x6000        /* Enable enclosing BORDER type 3 */
  48. #define    WCOPEN        0x1000        /* Clear window when opened */
  49. #define    WCCLOSE        0x0800        /* Clear window when closed */
  50. #define    WLF            0x0400        /* Disable NEWLINE, LF only */
  51. #define    WSCROLL        0x0200        /* Enable scrolling */
  52. #define    WWRAP        0x0100        /* Enable line=wrap */
  53.  
  54. /*
  55.  * Video attribute bit definitions
  56.  */
  57. #define BLINK        0x80        /* Blinking video modes */
  58. #define INTENSE        0x08        /* Intensity control */
  59.  
  60. /*
  61.  * Color video attribute bits (Color adapters only).
  62.  * The individual RED, GREEN and BLUE bits may be combined
  63.  * to provide 8 distinct foreground and background colors.
  64.  * Note: INTENSE bit affects foreground colors only.
  65.  */
  66. #define F_RED        0x04        /* Foreground RED */
  67. #define F_GREEN        0x02        /* Foreground GREEN */
  68. #define F_BLUE        0x01        /* Foreground BLUE */
  69. #define B_RED        0x40        /* Background RED */
  70. #define B_GREEN        0x20        /* Background GREEN */
  71. #define B_BLUE        0x10        /* Background BLUE */
  72.  
  73. /* Monochrome video attributes (Monochrome adapters only) */
  74. #define    NORMAL        0x07        /* Monochrome normal video */
  75. #define REVERSE        0x70        /* Monochrome reverse video */
  76. #define UNDERLINE    0x01        /* Monochrome underline video */
  77.  
  78. /*
  79.  * Structure of window control block
  80.  */
  81. struct WINDOW {
  82.     unsigned int        WINattr;
  83.     unsigned char        WINorgx, WINorgy;
  84.     unsigned char        WINwidth, WINheight;
  85.     unsigned char        WINcurx, WINcury;
  86.     struct     WINDOW        *WINprevious;
  87.     unsigned char        WINpcure, WINpcurs;
  88.     unsigned char         WINpcurx, WINpcury;
  89.     char                WINdata[]; };
  90.  
  91. /*
  92.  * External definitions in windowing library
  93.  */
  94. extern int                W_BASE;
  95. extern struct WINDOW    *W_OPEN;
  96. extern register            wform(), wprintf(), w_printf();
  97.